package com.nsi.o2o.enums;

/**
 * @author: Luo Zhen
 * @date: 2018/9/16 20:30
 * @description:
 */
public enum ProductCategoryEnum {

    SUCCESS(1, "操作成功"),
    INNER_ERROR(-1001, "操作失败"),
    EMPTY_LIST(-1002, "添加数据有误"),
    NULL_SHOP(-1003, "shop信息为空");

    private int state;
    private String stateInfo;

    private ProductCategoryEnum(int state, String stateInfo) {
        this.state = state;
        this.stateInfo = stateInfo;
    }

    public static ProductCategoryEnum stateOf(int state) {
        for (ProductCategoryEnum stateEnum : values()) {
            if (stateEnum.getState() == state) {
                return stateEnum;
            }
        }
        return null;
    }

    public int getState() {
        return state;
    }


    public String getStateInfo() {
        return stateInfo;
    }
}
